{% extends "home.html" %}
{% block right_content %}
    {% include 'common/tab_user.html' %}
    <div class="row m-t  user_edit_wrap">
        <div class="col-lg-12">
            <h2 class="text-center">账号信息编辑</h2>
            <div class="col-lg-4">
                <div style="border-radius:50%;overflow:hidden; width:250px;height:250px;margin-bottom: 10px;">
                    <img {% if current_user.avatar %} src="{{ buildStaticUrl(current_user.avatar) }}" {% else %}
                                                      src="{{ buildStaticUrl('/images/photo/f2f38bbfd59a75381852748962f83943.jpeg') }}" {% endif %}
                                                      alt="" width="250px" height="250px;">
                </div>
                <button style="margin-left: 80px;" class="btn btn-success" onclick="upload_image_layer();">修改头像</button>
            </div>
            <div class="form-horizontal col-lg-8 m-t m-b" style="margin-top: 40px;">
                <div class="form-group">
                    <label class="col-lg-2 control-label">手机:</label>
                    <div class="col-lg-10">
                        <input type="text" name="mobile" class="form-control" placeholder="请输入手机~~" readonly=""
                               value="{{ current_user.mobile }}">
                    </div>
                </div>
                <div class="hr-line-dashed"></div>

                <div class="form-group">
                    <label class="col-lg-2 control-label">姓名:</label>
                    <div class="col-lg-10">
                        <input type="text" name="nickname" class="form-control" placeholder="请输入姓名~~"
                               value="{{ current_user.nickname }}">
                    </div>
                </div>
                <div class="hr-line-dashed"></div>

                <div class="form-group">
                    <label class="col-lg-2 control-label">邮箱:</label>
                    <div class="col-lg-10">
                        <input type="text" name="email" class="form-control" placeholder="请输入邮箱~~"
                               value="{{ current_user.email }}">
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <div class="col-lg-4 col-lg-offset-2" style="margin-top: 70px;">
                        <button class="btn btn-w-m btn-outline btn-primary save">保存</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}

{% block js %}
    <script src="{{ buildStaticUrl('/js/user/edit.js') }}"></script>
    <script>
        function upload_image_layer() {
            layer.open({
                title: "上传头像",
                area: ['650px', '600px'],
                type: 2,
                content: "upload_avatar",
            });
        }
    </script>
{% endblock %}
